#include <algorithm>
#include <vector>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <cstdio>
#include <set>
#include <map>
#include <cstdlib>
#define LL long long
#define ldb long double
const ldb eps = 1e-9;
const ldb pi = fabsl(atan2(0.0, -1.0));
const int INF = 0x7f7f7f7f;
const LL LINF = 1ll << 60;
const ldb LDINF = 1e42;
#define nextLine() {int c = 0; while ((c = getchar()) != 10 && c != EOF);}
#define addEdge(a, b) next[edges] = first[a]; first[a] = edges; end[edges] = b; edges++;
using namespace std;

int n, k;
LL a[1010];
LL l[1010], r[1010];
ldb dp[1010][1010];
bool was[1010][1010];

int getLen(LL a)
{
	int len = 0;
	while (a > 0ll)
	{
		a /= 10ll;
		len++;
	}
	return len;	
}

int getFirst(LL a)
{
	int lst = 0;
	while (a > 0ll)
	{
		lst = a % 10ll;
		a /= 10ll;
	}
	return lst;
}

LL getCnt(LL a)
{
	if (a == 0ll) return 0;
	int len = getLen(a) - 1;
	LL res = 0;
	if (getFirst(a) == 1)
	{
		int i;
		LL f = 1;
		for (i = 0; i < len; i++)
			f *= 10ll;
		res += a - f + 1;
		len--;
	}
	if (len >= 0)
	{
		LL f = 1;
		for (int i = 1; i <= len; i++)
		{
			f *= 10ll;
			f++;
		}
		res += f;
	}
	return res;
}

void Load()
{
 	cin >> n;
	int i;
	for (i = 0; i < n; i++)
	{
		cin >> l[i] >> r[i];
		a[i] = getCnt(r[i]) - getCnt(l[i] - 1);
		//cerr << getCnt(r[i]) << " " << getCnt(l[i] - 1) << " " << a[i] << "\n";
	}
	cin >> k;
}


ldb f(int i, int j)
{
	if (i == n)
	{
		if (j * 100 >= k * n) return 1.0;
		else return 0.0;
	}
	if (was[i][j]) return dp[i][j];
	was[i][j] = 1;
	dp[i][j] = 0;
	dp[i][j] = (ldb)a[i] / (ldb)(r[i] - l[i] + 1) * f(i + 1, j + 1)
	 + ((ldb)1.0 - (ldb)a[i] / (ldb)(r[i] - l[i] + 1)) * f(i + 1, j);
	return dp[i][j];
}

void Solve()
{
	memset(was, 0, sizeof was);
	cout << setprecision(10) << fixed << f(0, 0);
}

int main()
{
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
	#endif
	Load();
	Solve();
	return 0;
}